package com.example.demo.mapper;

import com.example.demo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleInfoMapper {
    //添加方法
    public int add(@Param("articleInfo") ArticleInfo articleInfo);

    //添加文章后,返回添加文章的自增id
    public int addGetId(@Param("articleInfo") ArticleInfo articleInfo);

    //根据id删除文章
    public int delById(@Param("id") Integer id);

    //修改标题
    public int updateTitle(@Param("id") Integer id,@Param("title") String title);

    //多表查询
    public List<ArticleInfo> getAll();
}
